package com.android.rotary

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.dq.ad.AdManager
import com.module.rotary.activity.RotaryActivity
import com.module.rotary.dialog.DialogRotary
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        PermissionUtil.check()
        AdManager.getInstance().preLoadSplash(this)
        btnStart.setOnClickListener {
            val intent = Intent(this, RotaryActivity::class.java)
            startActivity(intent)
        }
        btnShowDialog.setOnClickListener {
            DialogRotary(this).then { dialog -> dialog!!.dismiss() }.show()
        }
    }
}